package io.fatmore.web.export;

import java.util.List;

public class ExcelMeta {
	/**
	 * eg: getName
	 * 如果你需要传参，则用空格分开，eg: get name
	 * 请注意大小写的区分
	 * 目前只支持一个参数的传参
	 * 
	 */
	private String getter;
	private String title;
	/**
	 * 替换处理程序
	 */
	private List<ExcelMetaReplaceInterface> replaces;
	/**
	 * 表达式列表，这个表达式不建议外部赋值
	 */
	private List<ExcelMetaExpress> expresses;
	private String[] keys;

	private boolean sum = false;
	private boolean avg = false;

	private ExcelMeta() {

	}

	public ExcelMeta(String key, String title) {
		this.getter = key;
		this.keys = key.split("\\+");
		this.title = title;
	}

	public ExcelMeta(String key, String title, List<ExcelMetaReplaceInterface> replaces) {
		this.getter = key;
		this.keys = key.split("\\+");
		this.title = title;
		this.replaces = replaces;
	}

	public void setKey(String key) {
		this.getter = key;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public boolean isSum() {
		return sum;
	}

	public void setSum(boolean sum) {
		this.sum = sum;
	}

	public boolean isAvg() {
		return avg;
	}

	public void setAvg(boolean avg) {
		this.avg = avg;
	}

	public String getGetter() {
		return getter;
	}

	public void setGetter(String getter) {
		this.getter = getter;
	}

	public List<ExcelMetaReplaceInterface> getReplaces() {
		return replaces;
	}

	public void setReplaces(List<ExcelMetaReplaceInterface> replaces) {
		this.replaces = replaces;
	}

	public List<ExcelMetaExpress> getExpresses() {
		return expresses;
	}

	public void setExpresses(List<ExcelMetaExpress> expresses) {
		this.expresses = expresses;
	}

	public String[] getKeys() {
		return keys;
	}

	public void setKeys(String[] keys) {
		this.keys = keys;
	}
}
